import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int m= sc.nextInt();
        int[][] arr=new int[n][m];
        int i=0;
        int max=0;
        int maxx=0;
        int maxy=0;
        for(i=0;i<n;i++){
            for(int j=0;j<m;j++){
                arr[i][j]=sc.nextInt();
                if(arr[i][j]>=max){
                    max=arr[i][j];
                    maxx=i+1;
                    maxy=j+1;
                }
            }
        }
        System.out.print(maxx+" ");
        System.out.println(maxy);
    }
}